// 设置 face-api.js 所需的环境变量
self.getEnv = () => ({
  isBrowser: true,
  isNode: false,
  Canvas: OffscreenCanvas,
  Image: null,
  ImageData: null,
  Video: null,
  createCanvasElement: () => new OffscreenCanvas(1, 1),
  createImageElement: () => null,
  fetch: fetch,
  readFile: null
});

// 添加其他必要的环境变量
self.env = self.getEnv();
self.isBrowser = true;
self.isNode = false; 